#include "finishscreen.h"

FinishScreen::FinishScreen(QWidget *parent) :
    QWidget(parent)
{
    finishLabel = new QLabel("FINISHED",this);
    closeLabel = new QLabel("TAP TO CLOSE", this);
    errorLabel = new QLabel("YOUR ERROR: ",this);

    QVBoxLayout* layout = new QVBoxLayout(this);
    layout->setAlignment(Qt::AlignCenter);
    layout->addWidget(finishLabel);
    layout->addWidget(closeLabel);
    layout->addWidget(errorLabel);

}


void FinishScreen::mousePressEvent(QMouseEvent *)
{
      QApplication::quit();
}

void FinishScreen::setError(double error_)
{
    error = error_;
    errorLabel->setText(QString("YOUR ERROR: ") + QString::number(error,'f',2));
}
